
subjectList = {...
    'N072912R'...
    'A080512A'...
    'K091412S'...
    'M101012R'...
    'R091412V'...
    };

f_thresh = 1;
analysesDir = '/Volumes/cluster/jet/mattar/AdaptID/Analyses/';
FFAcontrast = 2; %1 for Faces-Objects, 2 for Faces-Scenes

numSubjects = length(subjectList);

adaptationCurve = zeros(numSubjects,6);
std_adaptationCurve = zeros(numSubjects,6);

for subjIndx = 1:numSubjects
    [averageBetas maskedBetas averageBetasMatrix stdBetasMatrix] = extractROImask(subjectList{subjIndx}, f_thresh, FFAcontrast, analysesDir);
    adaptationCurve(subjIndx,:) = nanmean(averageBetasMatrix);
    std_adaptationCurve(subjIndx,:) = nanstd(averageBetasMatrix);
end

errorbar(adaptationCurve',std_adaptationCurve')
legend(subjectList{1}, subjectList{2}, subjectList{3}, subjectList{4}, subjectList{5})
ylabel('Beta value')
xlabel('Steps back')
axis([1 6 -80 80]);
set(gca,'XTick',[1:6]);